By convention, header filenames have a .h suffix. Each programming language handles these files the same way, via the macro preprocessor. For example, the stdio.h header file describes, among other things, the data types of the parameters required by printf().
For detailed information about standard header files and libraries, see the International Standard ISO/IEC. Programming languages--C, 9899. 1990. Also see "Using Typedefs" for information about the inttypes.h header file.
where filename is the name of the header file to be included. The angle brackets (< >) surrounding the filename tell the macro preprocessor to search for the specified file only in directories specified by command-line options and in the default header-file directory (/usr/include).#include <filename>
Another specification format exists, in which the filename is given between double quotation marks. In this case, the macro preprocessor searches for the specified header file in the current directory first (that is, the directory containing the including file). Then, if the preprocessor doesn't find the requested file, it searches in the other directories as in the angle-bracket specification.
To set up a shareable header file, create a .h file and enter the definitions for the various languages as follows:
#ifdef _LANGUAGE_C C definitions #endif #ifdef _LANGUAGE_C_PLUS_PLUS C++ definitions #endif #ifdef _LANGUAGE_FORTRAN Fortran definitions #endif
Note: You must specify _LANGUAGE_ before the language name. To indicate C++ definitions, you must use _LANGUAGE_C_PLUS_PLUS, not _LANGUAGE_C++. You can specify the various language definitions in any order.